package com.guigu.gateway.feign;

import com.guigu.gateway.pojo.AuthResource;
import com.guigu.gateway.utils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Set;

/**
 * @ClassName:AuthFeign
 * @Description://TODO
 * @Author:taoLong
 * @Date:2021/12/11:20:57 星期六
 * @email:2391611102@qq.com or 2391611102qq@gmail.com
 */
@FeignClient(value = "service-auth", path = "/auth")
public interface AuthFeign {
    /***
     * 根据用户id获取权限列表
     * @param userId
     * @return
     */
    @ApiOperation("根据用户id获取权限列表")
    @GetMapping("/auth-resource/queryResourcesBasedOnUserId/{userId}")
    public R<Set<AuthResource>> queryResourcesBasedOnUserId(@PathVariable("userId") String userId);


    /***
     * 查询全部权限信息
     * @return
     */
    @ApiOperation("查询全部权限信息")
    @GetMapping("/auth-resource/queryAll")
    public R<List<AuthResource>> queryAll();
}
